package com.freemypay.test.并发.捕获异常;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * 线程run()方法中逃逸的异常无法捕获。
 * 除非采取特殊的步骤。
 * @author yesixian
 * @date 2018年5月14日
 */
public class ExceptionThread implements Runnable {

	@Override
	public void run() {
		throw new RuntimeException();
	}
	
	public static void main(String[] args) {
		ExecutorService exec = Executors.newCachedThreadPool();
		exec.execute(new ExceptionThread());
	}

}
